<!DOCTYPE HTML>
<html>
<head>


<link href="templates/cli3/css/cli3.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
    // create a new Date object then get the current time
    var start = new Date();
    var startsec = start.getTime();

    // run a loop counting up to 250,000
    var num = 0;
    for( var i = 0; i < 250000; i++ )
    {
    num++;
    }

    var stop  = new Date();
    var stopsec = stop.getTime();

    var loadtime = ( stopsec - startsec ) / 1000;
</script>
</head>
<body>

<?php
require_once("mainfile.php");
$_SERVER['PHP_SELF'] = "index.php";
if(ISO==='utf-8'){
    require_once("templates/".WEB_TEMPLATES."/lang/tem_thai_utf8.php");
} else {
    require_once("templates/".WEB_TEMPLATES."/lang/tem_thai_tis620.php");
}
?>
<div id="dhtmltooltip"></div>

<table width="1024" height="100%" border="0" align="center" cellPadding="0" cellSpacing="0" bgcolor="#ffffff">
<tr>
<td width="1024" align="center" valign="top" >
<div align="center">
<div id="outer1" >
<div id="outer2" >
<table id="Table_01" width="<?php echo _TEMPLATES_WIDTH_CONFIG;?>" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6" id="sizer">
<?php
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD); // Connect DB
$res['config'] = $db->select_query("SELECT * FROM ".TB_CONFIG.",".TB_TEMPLATES." where name=temname and sort='1' ");
$arr['config'] = $db->fetch($res['config']);

//$db->closedb (); // Disconnect DB
 $types=$arr['config']['type'];

 if ($types !='application/x-shockwave-flash' ) {
?>
<table width="<?php echo $arr['config']['width'];?>" align=right cellSpacing=0 cellPadding=0 border=0>
<tr>
<td valign="top" width="<?php echo $arr['config']['width'];?>" background="templates/<?echo WEB_TEMPLATES;?>/images/config/<?php echo $arr['config']['picname'];?>"  width="<?php echo $arr['config']['width'];?>" height="<?php echo $arr['config']['height'];?>" border="0" valign="top" colspan="6">
<table align=right cellSpacing=0 cellPadding=0 border="0">
<tr>
<td colspan="6" align="right" >
		<?
empty($_SESSION['admin_user'])?$admin_user="":$admin_user=$_SESSION['admin_user'];
empty($_SESSION['admin_pwd'])?$admin_pwd="":$admin_pwd=$_SESSION['admin_pwd'];
empty($_SESSION['login_true'])?$login_true="":$login_true=$_SESSION['login_true'];
if ($admin_user) {
echo "<font color=#CFCFCF><b>"._TEM_WEL." </font><font color=#3366FF>$admin_user </b></font>";
}else if($login_true){
echo "<font color=#CFCFCF><b>"._TEM_WEL." </font><font color=#00CC33>$login_true </b></font>";
} else {
echo "<font color=#CFCFCF><b>"._TEM_WEL." </font><font color=#CC0000>"._TEM_WEL_GUEST."</b></font>";
}
?>
&nbsp;&nbsp;<br>
</td>
</tr>
<?php if (CountBlock('header')) { ?>
<tr><td colspan="6" align="right" >
<?php
LoadBlock('header'); 
?>
</td>
</tr>
<?php } ?>
    <tr>
        <td background="templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu_01.png" width="95" height="37" border="0">
            <a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu1_01.png',1)">
                <img src="templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu_01.png" width="95" height="37" alt="" name="home">
            </a>
        </td>
        <td background="templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu_03.png" border="0" width="96" height="37">
            <a href="?name=webboard" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('webboard','','templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu1_03.png',1)">
                <img src="templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu_03.png" width="96" height="37" name="webboard" alt="">
            </a>
        </td>
        <td background="templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu_06.png" border="0" width="91" height="37">
            <a href="?name=admin" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('admin','','templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu1_06.png',1)">
                <img src="templates/<?php echo WEB_TEMPLATES;?>/images/menu/menu_06.png" width="91" height="37" alt="" name="admin">
            </a>
        </td>
    </tr>
</table>
</td>
</tr>
</table>
<?php 
	} else {
		  ?>

<table width="<?php echo $arr['config']['width'];?>" align=center cellSpacing=0 cellPadding=0 border=0>
<tr>
<td width="<?php echo $arr['config']['width'];?>" border="0">
</td>
</tr>
</table>
<?php 
}
?>


						</td>
					</tr>
					<tr>
						<td colspan="6"><?php  include 'modules/config/top2.php'; ?></td>
					</tr>
					<tr>
						<td colspan="6" background="templates/<?php echo WEB_TEMPLATES;?>/images/bar.png" width=1000 height=27 >
							<?php if (CountBlock('pathway')) { ?>
													<?php LoadBlock('pathway'); ?>
									<?php } ?>
						</td>
					</tr>
				</table>

<center>
				<table cellSpacing=0 cellPadding=0 width=<?php echo _TEMPLATES_WIDTH_CONFIG;?> align=center border=0>
				<tbody>
				</table>
<table cellSpacing=0 cellPadding=0 width=990 align=center border=0>
<tr>
<td width=990>
				<table cellSpacing=0 cellPadding=0 width=990 align=center border=0>
				<tbody>
					<tr>
					<td width="220" valign="top">
					<?php  if($name<>"admin" && $name<>"admin/workboard" && $name<>"admin/backup" ) { ?>


<?php  //blockleft;?>

<?php if (CountBlock('left')) { ?>
<!-- Left Menu -->
<table cellspacing="0" cellpadding="0" width="220" >
    <tr>
        <td width="220" valign="top" id="leftcol">
        <?php LoadBlock('left'); ?>
        </td>
    </tr>
</table><br>
<?php } ?>


<?php }?>
</td>
<td vAlign="top" align="center" width="10" ></td>
<td vAlign="top" align="center" width="100%" align="center">

<?php  if($name=="") { ?>

<table width="100%" cellspacing="0" cellpadding="0" >
<tr>
<td width="10" vAlign=top><IMG src="images/fader.gif" border=0></td>
<td width="770" vAlign=top align=left><IMG src="images/topfader.gif" border=0><BR>
<!-- Admin -->
&nbsp;&nbsp;
<?php  //blockcenter;?>
<?php if (CountBlock('user2')) { ?>

<!-- User2 -->
<table width="100%" cellspacing="0" cellpadding="0" >
    <tr>
        <td >
            <div >
            <?php LoadBlock('user2'); ?>
            </div>
        </td>
    </tr>
</table>
<br>
<?php } ?>

<?php if (CountBlock('center')) { ?>
<table cellspacing="0" cellpadding="0" width="100%">
    <tr>
        <td >
            <div >
            <?php LoadBlock('center'); ?>
            </div>
        </td>
    </tr>
</table>
<br>
<?php } ?>
									
<?php if (CountBlock('user1')) { ?>
<!-- Webboard -->
<center>
    <table width="100%" cellspacing="0" cellpadding="0" >
        <tr>
            <td>
                <div id="main_top_wrape">
                <?php LoadBlock('user1'); ?>
                </div>
            </td>
        </tr>
    </table><br>
</center>
<?php } ?>

				</td>


<? //blockright;?>
<?php /*if (CountBlock('right')) { ?>
<td width="10" vAlign=top></td>
<td width="220" vAlign=top align=left>

<table cellspacing="0" cellpadding="0" width="220" >
<tr>
<td width="220" valign="top"  align="center">
<?php LoadBlock('right'); ?>
</td>
</tr>
</table><br><br>
</td>
<?php }*/ ?>
			</td>
			</tr>
			</table>

<?php } else {
OpenTable();
require_once ("".$MODPATHFILE."");
 CloseTable();
} ?>
</td>
						</tr>
						</table>
</td>
</tr>
<?php if (CountBlock('bottom')) { ?>
    <tr>
        <td>
            <table width="<?php echo _TEMPLATES_WIDTH_CONFIG;?>" cellspacing="0" cellpadding="0">
                <tr>
                    <td >
                        <div >
                        <?php LoadBlock('bottom'); ?>
                        </div>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
<?php } ?>
</table>

<!-- Bottom -->
<table border="0" align="center" cellpadding="0" cellspacing="0" width="<?php echo _TEMPLATES_WIDTH_CONFIG;?>">
    <tr>
        <td valign="top" class="footer" bgcolor="#1B6AE0">
        </td>
    </tr>
    <tr>
        <td valign="top" class="footer" bgcolor="#1B6AE0">
        </td>
    </tr>
</table>

</td>
</tr>
</table>
</div>
</div>
</div>
  </td>

    </tr>
  </tbody>
</table>
</body>
</html>